package operator.combine;

import io.reactivex.Observable;
import io.reactivex.functions.Consumer;
import util.Printer;

class CountOperator {

    public static void main(String[] args) {
        count();
    }

    /**
     * 返回个数
     */
    static void count(){
        Observable.just(1, 2, 3)
                .count()
                .subscribe(new Consumer<Long>() {
                    @Override
                    public void accept(Long aLong) throws Exception {
                        Printer.print("count = " + aLong);
                    }
                });
    }

}
